/*
* JoglCommon.java
* Copyright (C) 2004
* 
* $Id: JoglBase.java,v 1.15 2005/06/26 08:51:19 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
using System;
using Defines = Suake2.UI.Defines;
using VID = Suake2.UI.client.VID;
using viddef_t = Suake2.UI.client.viddef_t;
using cvar_t = Suake2.UI.game.cvar_t;
using Cbuf = Suake2.UI.qcommon.Cbuf;
using xcommand_t = Suake2.UI.qcommon.xcommand_t;
using JOGLKBD = Suake2.UI.sys.JOGLKBD;
//UPGRADE_TODO: The 'net.java.games.jogl' package was found, but not necessarily converted. References to it may cause compile errors. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1280'"
using net.java.games.jogl;
using GLUT = net.java.games.jogl.util.GLUT;
namespace Suake2.UI.render
{
	
	/// <summary> JoglCommon</summary>
	public abstract class JoglBase : GLEventListener
	{
		public JoglBase()
		{
			InitBlock();
		}
		static private System.Int32 state539;
		//UPGRADE_NOTE: Field 'EnclosingInstance' was added to class 'AnonymousClassxcommand_t' to access its enclosing instance. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1019'"
		public class AnonymousClassxcommand_t:xcommand_t
		{
			public AnonymousClassxcommand_t(JoglBase enclosingInstance)
			{
				InitBlock(enclosingInstance);
			}
			private void  InitBlock(JoglBase enclosingInstance)
			{
				this.enclosingInstance = enclosingInstance;
			}
			private JoglBase enclosingInstance;
			public JoglBase Enclosing_Instance
			{
				get
				{
					return enclosingInstance;
				}
				
			}
			public override void  execute()
			{
				// only used for the first run (initialization)
				// clear the screen
				Enclosing_Instance.gl.glClearColor(0, 0, 0, 0);
				Enclosing_Instance.gl.glClear(net.java.games.jogl.GL_Fields.GL_COLOR_BUFFER_BIT | net.java.games.jogl.GL_Fields.GL_DEPTH_BUFFER_BIT);
				
				//
				// check the post init process
				//
				if (!Enclosing_Instance.post_init)
				{
					VID.Printf(Defines.PRINT_ALL, "Missing multi-texturing for FastJOGL renderer\n");
				}
				
				Enclosing_Instance.GLimp_EndFrame();
			}
		}
		//UPGRADE_NOTE: Field 'EnclosingInstance' was added to class 'AnonymousClassWindowAdapter' to access its enclosing instance. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1019'"
		private class AnonymousClassWindowAdapter
		{
			public AnonymousClassWindowAdapter(JoglBase enclosingInstance)
			{
				InitBlock(enclosingInstance);
			}
			private void  InitBlock(JoglBase enclosingInstance)
			{
				this.enclosingInstance = enclosingInstance;
			}
			private JoglBase enclosingInstance;
			public JoglBase Enclosing_Instance
			{
				get
				{
					return enclosingInstance;
				}
				
			}
			public void  windowClosing(System.Object event_sender, System.ComponentModel.CancelEventArgs e)
			{
				e.Cancel = true;
				Cbuf.ExecuteText(Defines.EXEC_APPEND, "quit");
			}
		}
		private static void  keyDown(System.Object event_sender, System.Windows.Forms.KeyEventArgs e)
		{
			state539 = ((int) System.Windows.Forms.Control.MouseButtons  | (int) System.Windows.Forms.Control.ModifierKeys);
		}
		private static void  mouseDown(System.Object event_sender, System.Windows.Forms.MouseEventArgs e)
		{
			state539 = ((int) e.Button | (int) System.Windows.Forms.Control.ModifierKeys);
		}
		private void  InitBlock()
		{
			INIT_CALLBACK = new AnonymousClassxcommand_t(this);
			callback = INIT_CALLBACK;
		}
		virtual public DisplayMode[] ModeList
		{
			get
			{
				DisplayMode[] modes = device.getDisplayModes();
				//UPGRADE_TODO: Class 'java.util.LinkedList' was converted to 'System.Collections.ArrayList' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilLinkedList'"
				System.Collections.ArrayList l = new System.Collections.ArrayList();
				l.Add(oldDisplayMode);
				
				for (int i = 0; i < modes.length; i++)
				{
					DisplayMode m = modes[i];
					
					if (m.getBitDepth() != oldDisplayMode.getBitDepth())
						continue;
					if (m.getRefreshRate() > oldDisplayMode.getRefreshRate())
						continue;
					if (m.getHeight() < 240 || m.getWidth() < 320)
						continue;
					
					int j = 0;
					DisplayMode ml = null;
					for (j = 0; j < l.Count; j++)
					{
						ml = (DisplayMode) l[j];
						if (ml.getWidth() > m.getWidth())
							break;
						if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight())
							break;
					}
					if (j == l.Count)
					{
						l.Insert(l.Count, m);
					}
					else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight())
					{
						l.Insert(j, m);
					}
					else if (m.getRefreshRate() > ml.getRefreshRate())
					{
						l.RemoveAt(j);
						l.Insert(j, m);
					}
				}
				DisplayMode[] ma = new DisplayMode[l.Count];
				l.toArray(ma);
				return ma;
			}
			
		}
		
		// IMPORTED FUNCTIONS
		//UPGRADE_ISSUE: Class 'java.awt.GraphicsDevice' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtGraphicsDevice'"
		protected internal GraphicsDevice device;
		protected internal DisplayMode oldDisplayMode;
		protected internal GLCanvas canvas;
		internal System.Windows.Forms.Form window;
		
		protected internal GL gl;
		protected internal GLU glu;
		protected internal GLUT glut = new GLUT();
		
		// window position on the screen
		internal int window_xpos, window_ypos;
		protected internal viddef_t vid = new viddef_t();
		
		// handles the post initialization with JoglRenderer
		protected internal bool post_init = false;
		protected internal bool contextInUse = false;
		protected internal abstract bool R_Init2();
		
		//UPGRADE_NOTE: Final was removed from the declaration of 'INIT_CALLBACK '. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'"
		//UPGRADE_NOTE: The initialization of  'INIT_CALLBACK' was moved to method 'InitBlock'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1005'"
		protected internal xcommand_t INIT_CALLBACK;
		//UPGRADE_NOTE: The initialization of  'callback' was moved to method 'InitBlock'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1005'"
		protected internal xcommand_t callback;
		
		protected internal cvar_t vid_fullscreen;
		
		// enum rserr_t
		protected internal const int rserr_ok = 0;
		protected internal const int rserr_invalid_fullscreen = 1;
		protected internal const int rserr_invalid_mode = 2;
		protected internal const int rserr_unknown = 3;
		
		//UPGRADE_NOTE: ref keyword was added to struct-type parameters. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1303'"
		internal virtual DisplayMode findDisplayMode(ref System.Drawing.Size dim)
		{
			DisplayMode mode = null;
			DisplayMode m = null;
			DisplayMode[] modes = ModeList;
			int w = dim.Width;
			int h = dim.Height;
			
			for (int i = 0; i < modes.length; i++)
			{
				m = modes[i];
				if (m.getWidth() == w && m.getHeight() == h)
				{
					mode = m;
					break;
				}
			}
			if (mode == null)
				mode = oldDisplayMode;
			return mode;
		}
		
		internal virtual System.String getModeString(DisplayMode m)
		{
			System.Text.StringBuilder sb = new System.Text.StringBuilder();
			sb.Append(m.getWidth());
			sb.Append('x');
			sb.Append(m.getHeight());
			sb.Append('x');
			sb.Append(m.getBitDepth());
			sb.Append('@');
			sb.Append(m.getRefreshRate());
			sb.Append("Hz");
			return sb.ToString();
		}
		
		/// <param name="dim">
		/// </param>
		/// <param name="mode">
		/// </param>
		/// <param name="fullscreen">
		/// </param>
		/// <returns> enum rserr_t
		/// </returns>
		//UPGRADE_NOTE: ref keyword was added to struct-type parameters. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1303'"
		protected internal virtual int GLimp_SetMode(ref System.Drawing.Size dim, int mode, bool fullscreen)
		{
			
			System.Drawing.Size newDim = new System.Drawing.Size(0, 0);
			
			VID.Printf(Defines.PRINT_ALL, "Initializing OpenGL display\n");
			
			VID.Printf(Defines.PRINT_ALL, "...setting mode " + mode + ":");
			
			/*
			* fullscreen handling
			*/
			//UPGRADE_ISSUE: Class 'java.awt.GraphicsEnvironment' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtGraphicsEnvironment'"
			//UPGRADE_ISSUE: Method 'java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtGraphicsEnvironment'"
			GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
			//UPGRADE_TODO: Method 'java.awt.GraphicsEnvironment.getDefaultScreenDevice' was converted to 'System.Windows.Forms.Screen' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtGraphicsEnvironmentgetDefaultScreenDevice'"
			device = System.Windows.Forms.Screen.PrimaryScreen;
			
			if (oldDisplayMode == null)
			{
				oldDisplayMode = device.getDisplayMode();
			}
			
			//UPGRADE_NOTE: ref keyword was added to struct-type parameters. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1303'"
			if (!VID.GetModeInfo(ref newDim, mode))
			{
				VID.Printf(Defines.PRINT_ALL, " invalid mode\n");
				return rserr_invalid_mode;
			}
			
			VID.Printf(Defines.PRINT_ALL, " " + newDim.Width + " " + newDim.Height + '\n');
			
			// destroy the existing window
			GLimp_Shutdown();
			
			window = SupportClass.FormSupport.CreateForm("Jake2");
			//UPGRADE_TODO: Class 'javax.swing.ImageIcon' was converted to 'System.Drawing.Image' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingImageIcon'"
			//UPGRADE_ISSUE: Constructor 'javax.swing.ImageIcon.ImageIcon' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingImageIconImageIcon_javanetURL'"
			GetType();
			//UPGRADE_TODO: Method 'java.lang.Class.getResource' was converted to 'System.Uri' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangClassgetResource_javalangString'"
			System.Drawing.Image icon = new ImageIcon(new System.Uri(System.IO.Path.GetFullPath("/icon-small.png")));
			window.Icon = System.Drawing.Icon.FromHandle(((System.Drawing.Bitmap) icon).GetHicon());
			
			GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
			
			// we want keypressed events for TAB key
			canvas.setFocusTraversalKeysEnabled(false);
			
			// TODO Use debug pipeline
			//canvas.setGL(new DebugGL(canvas.getGL()));
			
			canvas.setNoAutoRedrawMode(true);
			canvas.setAutoSwapBufferMode(false);
			
			canvas.addGLEventListener(this);
			
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
			((System.Windows.Forms.ContainerControl) window).Controls.Add(canvas);
			//UPGRADE_TODO: Method 'java.awt.Component.setSize' was converted to 'System.Windows.Forms.Control.Size' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentsetSize_int_int'"
			canvas.Size = new System.Drawing.Size(newDim.Width, newDim.Height);
			
			// register event listener
			//UPGRADE_NOTE: Some methods of the 'java.awt.event.WindowListener' class are not used in the .NET Framework. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1308'"
			window.Closing += new System.ComponentModel.CancelEventHandler(new AnonymousClassWindowAdapter(this).windowClosing);
			
			// D I F F E R E N T   J A K E 2   E V E N T   P R O C E S S I N G      		
			//UPGRADE_WARNING: Extra logic should be included into componentHidden to know if the Component is hidden. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1144'"
			window.VisibleChanged += new System.EventHandler(JOGLKBD.listener.componentHidden);
			window.Move += new System.EventHandler(JOGLKBD.listener.componentMoved);
			window.Resize += new System.EventHandler(JOGLKBD.listener.componentResized);
			//UPGRADE_WARNING: Extra logic should be included into componentShown to know if the Component is visible. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1145'"
			window.VisibleChanged += new System.EventHandler(JOGLKBD.listener.componentShown);
			canvas.KeyDown += new System.Windows.Forms.KeyEventHandler(jake2.render.JoglBase.keyDown);
			canvas.KeyDown += new System.Windows.Forms.KeyEventHandler(JOGLKBD.listener.keyPressed);
			canvas.KeyUp += new System.Windows.Forms.KeyEventHandler(JOGLKBD.listener.keyReleased);
			canvas.KeyPress += new System.Windows.Forms.KeyPressEventHandler(JOGLKBD.listener.keyTyped);
			canvas.MouseDown += new System.Windows.Forms.MouseEventHandler(jake2.render.JoglBase.mouseDown);
			canvas.Click += new System.EventHandler(JOGLKBD.listener.mouseClicked);
			canvas.MouseEnter += new System.EventHandler(JOGLKBD.listener.mouseEntered);
			canvas.MouseLeave += new System.EventHandler(JOGLKBD.listener.mouseExited);
			canvas.MouseDown += new System.Windows.Forms.MouseEventHandler(JOGLKBD.listener.mousePressed);
			canvas.MouseUp += new System.Windows.Forms.MouseEventHandler(JOGLKBD.listener.mouseReleased);
			canvas.MouseMove += new System.Windows.Forms.MouseEventHandler(JOGLKBD.listener.mouseMoved);
			canvas.addMouseWheelListener(JOGLKBD.listener);
			
			if (fullscreen)
			{
				
				//UPGRADE_NOTE: ref keyword was added to struct-type parameters. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1303'"
				DisplayMode displayMode = findDisplayMode(ref newDim);
				
				newDim.Width = displayMode.getWidth();
				newDim.Height = displayMode.getHeight();
				window.setUndecorated(true);
				window.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
				window.MaximizeBox = false;
				
				device.setFullScreenWindow(window);
				
				if (device.isFullScreenSupported())
					device.setDisplayMode(displayMode);
				
				//UPGRADE_TODO: Method 'java.awt.Component.setLocation' was converted to 'System.Windows.Forms.Control.Location' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentsetLocation_int_int'"
				window.Location = new System.Drawing.Point(0, 0);
				window.setSize(displayMode.getWidth(), displayMode.getHeight());
				canvas.setSize(displayMode.getWidth(), displayMode.getHeight());
				
				VID.Printf(Defines.PRINT_ALL, "...setting fullscreen " + getModeString(displayMode) + '\n');
			}
			else
			{
				//UPGRADE_TODO: Method 'java.awt.Component.setLocation' was converted to 'System.Windows.Forms.Control.Location' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentsetLocation_int_int'"
				window.Location = new System.Drawing.Point(window_xpos, window_ypos);
				//UPGRADE_ISSUE: Method 'java.awt.Window.pack' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtWindowpack'"
				window.pack();
				window.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
				window.MaximizeBox = false;
				//UPGRADE_TODO: Method 'java.awt.Component.setVisible' was converted to 'System.Windows.Forms.Control.Visible' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentsetVisible_boolean'"
				//UPGRADE_TODO: 'System.Windows.Forms.Application.Run' must be called to start a main form. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1135'"
				window.Visible = true;
			}
			
			//UPGRADE_ISSUE: Method 'java.awt.Component.isDisplayable' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtComponentisDisplayable'"
			while (!canvas.isDisplayable())
			{
				try
				{
					//UPGRADE_TODO: Method 'java.lang.Thread.sleep' was converted to 'System.Threading.Thread.Sleep' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangThreadsleep_long'"
					System.Threading.Thread.Sleep(new System.TimeSpan((System.Int64) 10000 * 50));
				}
				catch (System.Threading.ThreadInterruptedException e)
				{
				}
			}
			canvas.Focus();
			
			this.canvas = canvas;
			
			vid.width = newDim.Width;
			vid.height = newDim.Height;
			
			// let the sound and input subsystems know about the new window
			VID.NewWindow(vid.width, vid.height);
			
			return rserr_ok;
		}
		
		protected internal virtual void  GLimp_Shutdown()
		{
			if (oldDisplayMode != null && device.getFullScreenWindow() != null)
			{
				try
				{
					if (device.isFullScreenSupported())
						device.setDisplayMode(oldDisplayMode);
					device.setFullScreenWindow(null);
				}
				catch (System.Exception e)
				{
					SupportClass.WriteStackTrace(e, Console.Error);
				}
			}
			if (window != null)
			{
				// this is very important to change the GL context
				if (canvas != null)
				{
					canvas.Visible = false;
					window.Controls.Remove(canvas);
					canvas = null;
				}
				window.Dispose();
			}
			post_init = false;
			callback = INIT_CALLBACK;
		}
		
		/// <returns> true
		/// </returns>
		protected internal virtual bool GLimp_Init(int xpos, int ypos)
		{
			// do nothing
			window_xpos = xpos;
			window_ypos = ypos;
			return true;
		}
		
		protected internal virtual void  GLimp_EndFrame()
		{
			gl.glFlush();
			canvas.swapBuffers();
		}
		protected internal virtual void  GLimp_BeginFrame(float camera_separation)
		{
			// do nothing
		}
		
		protected internal virtual void  GLimp_AppActivate(bool activate)
		{
			// do nothing
		}
		
		protected internal virtual void  GLimp_EnableLogging(bool enable)
		{
			// doesn't need jogl logging
			// do nothing
		}
		
		protected internal virtual void  GLimp_LogNewFrame()
		{
			// doesn't need jogl logging
			// do nothing
		}
		
		/* 
		* @see jake2.client.refexport_t#updateScreen()
		*/
		public virtual void  updateScreen()
		{
			this.callback = INIT_CALLBACK;
			canvas.display();
		}
		
		public virtual void  updateScreen(xcommand_t callback)
		{
			this.callback = callback;
			canvas.display();
		}
		// ============================================================================
		// GLEventListener interface
		// ============================================================================
		
		/* 
		* @see net.java.games.jogl.GLEventListener#init(net.java.games.jogl.GLDrawable)
		*/
		public virtual void  init(GLDrawable drawable)
		{
			this.gl = drawable.getGL();
			this.glu = drawable.getGLU();
			
			// this is a hack to run R_init() in gl context
			post_init = R_Init2();
		}
		
		/* 
		* @see net.java.games.jogl.GLEventListener#display(net.java.games.jogl.GLDrawable)
		*/
		public virtual void  display(GLDrawable drawable)
		{
			this.gl = drawable.getGL();
			this.glu = drawable.getGLU();
			
			contextInUse = true;
			callback.execute();
			contextInUse = false;
		}
		
		/* 
		* @see net.java.games.jogl.GLEventListener#displayChanged(net.java.games.jogl.GLDrawable, boolean, boolean)
		*/
		public virtual void  displayChanged(GLDrawable drawable, bool arg1, bool arg2)
		{
			// do nothing
		}
		
		/* 
		* @see net.java.games.jogl.GLEventListener#reshape(net.java.games.jogl.GLDrawable, int, int, int, int)
		*/
		public virtual void  reshape(GLDrawable drawable, int x, int y, int width, int height)
		{
			// do nothing
		}
	}
}